#version 130


uniform vec3 lightDir;

in vec4 vVertex;
in vec4 vColor;
in vec3 vNormal;
in vec2 vTexCoord;

out vec3 fNormal;
out vec3 fLightDir;
out vec3 fEyeVec;


void main()
{	
	normal = normalize( gl_NormalMatrix * vNormal.xyz );
	fNormal = normal;
	
	fLightDir = lightDir;
	
	

	vec3 vVertex = vec3(gl_ModelViewMatrix * vVertex);

	lightDir = vec3(gl_LightSource[0].position.xyz - vVertex);
	eyeVec = -vVertex;
	fEyeVec = eyeVec;

	gl_Position = gl_Position = gl_ModelViewProjectionMatrix * vVertex;
}